package com.service.impl;

import com.domain.Role;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.RoleMapper;
import com.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("RoleService")
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public PageInfo<Role> selectRoleAll(int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        List<Role> roleList = roleMapper.selectRoleAll();
        PageInfo<Role> pageInfo = new PageInfo<Role>(roleList);
        return pageInfo;
    }

    @Override
    public void insert(Role role) {
        roleMapper.insert(role);
    }
}
